<template>
	<view style="display: flex;justify-content: center;align-items: center;">
		<nuoyu-coupons :couponList="couponList" @onReceive="onReceive"></nuoyu-coupons>
		
	</view>
</template>

<script>
export default {
	data() {
		return {
			couponList:[],
		}
	  },
	onLoad() {
		
		this.getCoupons();
	},
	methods: {
		onReceive(item,index){
			if(item.item_id){
				uni.navigateTo({
					url:"/pages/goods/goodsDetails"+`?goods_id=${item.item_id}`
				})
			}else{
				uni.navigateTo({
					url:"/pages/goods/goodsList"  // 获取当前店铺
				})
			}
			
		},
		getCoupons(){
			this.tui.request("/basic-capi/getCoupons/list", "get",{
			}).then((res) => {
				if(res.code == 200){
					this.couponList = res.data.list
				}else{
					 
					this.tui.toast(res.message)
				}
			})
		}
	}
}
</script>

<style scoped lang="scss">
	.user_account {
				// width: 115rpx;
				// height: 115rpx;
				opacity: 1;
			
				// background-color: lightblue;
				display: flex;
				justify-content: center; /* 水平居中 */
				align-items: center; /* 垂直居中 */
				width: 115rpx;
				height: 115rpx; /* 容器高度 */
				 text-align: center;
				image {
					width:100%;
					height:100%;
					// border: 2rpx solid #FFFFFF;
				 
					border-radius: 50%;
					transform: scale(1.1);
					vertical-align: middle; /* 垂直居中 */
					// transform: scale(1.5);
				}
			}
</style>